﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using MsForgeReboot.Framework.Entities;

namespace MsForgeReboot.Framework.Interfaces {
    /// <summary>
    /// Service to work with Users form a DB standpoint. Since we don't want to have a tie to
    /// the WebSecurity classes, this service will be very skinny and will only deal with users.
    /// </summary>
    public interface IUserService {
        
        IList<User> GetUsers();

        /// <summary>
        /// Get usersnames from a string of ids from the client.
        /// </summary>
        /// <param name="ids">Comma-separated IDs</param>
        /// <returns>Array of usernames</returns>
        string[] GetUsernames(string ids, string separator = ",");

        IList<User> FilterUsersByUsername(string username);

        User GetSingleUser(int id);

        User GetSingleUser(string username);

        void SaveOrEdit(int id, string userName, string publicName = null, bool? notifications = null);

        void DeleteUser(int id);

        /// <summary>
        /// Searches the users.
        /// </summary>
        /// <param name="searchTerm">The search term.</param>
        /// <returns>Top 10 results based on email or public name</returns>
        IList<User> SearchTopTenUsers(string searchTerm);
    }
}
